<div class="blade-content ng-scope" id="blade-content">
  <div class="blade-inner">
    <div class="inner-block">
      <div class="tag">
        <p-autoComplete *ngIf="parentEntity.current.multipleValue" [(ngModel)]="brand" [suggestions]="tagData" (completeMethod)="filterBrands($event)"
          [minLength]="1" placeholder="请输入测点名称" [dropdown]="true" (onDropdownClick)="handleDropdownClick($event)">
          <ng-template let-brand pTemplate="item">
            <div class="ui-helper-clearfix" style="border-bottom:1px solid #D5D5D5">
              <div style="font-size:14px;margin:10px 10px 0 0;padding:0 10px ">{{brand}}</div>
            </div>
          </ng-template>
        </p-autoComplete>
      </div>
      <form name="form" (submit)="onCreate()" [formGroup]="formGroup" novalidate>
        <div class="blade-static __bottom" *ngIf="currentBlade.isNew">
          <button class="btn" [disabled]="!formGroup.valid">创建</button>
        </div>
        <div class="tag-bottom">
          <div class="form-group">
            <label class="form-label">故障码</label>
            <div class="form-input">
              <input placeholder="请输入故障码" name="faultCode" formControlName="faultCode">
            </div>
            <div *ngIf="formErrors.faultCode" class="form-error">
              {{ formErrors.faultCode }}
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">故障信息</label>
            <div class="form-input">
              <input placeholder="请输入故障信息" name="faultDesc" formControlName="faultDesc">
            </div>
            <div *ngIf="formErrors.faultDesc" class="form-error">
              {{ formErrors.faultDesc }}
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">系统或设备</label>
            <div class="form-input">
              <select name="turbComponentId" (ngModelChange)="onComponentChange($event)" formControlName="turbComponentId">
              <option [value]="c.turbComponentId" *ngFor="let c of turbComponentList">
                {{c.turbComponentName}}
              </option>
              
            </select>
            </div>
          </div>

          <div class="form-group" *ngIf="subComponents.length > 0 ? true: false">
            <label class="form-label">子系统或部件</label>
            <div class="form-control __checkbox part">
              <label class="form-label" *ngFor="let item of subComponents;let i=index">
                  <input type="checkbox" [checked]="item.isChecked" (click)="subComponentChecked($event.target.checked , item)">
                  <span class="check"></span>
                  <span class="name">{{ item.turbComponentName}}_{{item.turbComponentId}}</span>
              </label>
              <input type="hidden" name="subComponentIds" formControlName="subComponentIds">
            </div>
          </div>

          <div class="form-group" *ngIf="isShowPart">
            <label class="form-label">零部件</label>
            <div class="form-control __checkbox part" *ngFor="let item of partsData;let i=index">
              <label class="form-label">{{ item.subComponent.turbComponentName }}：</label>
              <label class="form-label" *ngFor="let c of item.parts; let i=index">
                  <input type="checkbox" [checked]="c.isChecked" (click)="partChecked($event.target.checked , c)">
                  <span class="check"></span>
                  <span class="name">{{ c.turbComponentName}}_{{c.turbComponentId}}</span>
              </label>
              <input type="hidden" name="partsIds" formControlName="partsIds">
            </div>
          </div>

          <div class="form-group">
            <label class="form-label">报警类别</label>
            <div class="form-input">
              <select name="alarmCategoryId" formControlName="alarmCategoryId">
              <option [value]="c.alarmCategoryId" *ngFor="let c of parentEntity.alarmCategory">
                {{c.alarmCategoryName}}
              </option>
              
            </select>
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">故障级别</label>
            <div class="form-input">
              <select name="faultLevelId" formControlName="faultLevelId">
              <option [value]="c.faultLevelId" *ngFor="let c of parentEntity.faultLevel">
                {{c.faultLevelName}}
              </option>              
            </select>
            </div>
          </div>
          <!-- <div class="form-group">
            <label class="form-label">是否报警</label>
            <input type="checkbox" name="unAlarm" formControlName="unAlarm">
          </div> -->


          <div class="form-group">
            <label class="form-label">是否报警</label>
            <div class="form-input" id="form-input-switch">
              <label class="form-label __switch">
                    <input type="checkbox" name="unAlarm" formControlName="unAlarm" class="ng-pristine ng-untouched ng-valid">
                    <span class="switch"></span>
                </label>
            </div>
          </div>

        </div>
      </form>

    </div>
  </div>
</div>